<?php
/**
 * @author wangwei 2010-5-29
 * 修正函数
 */
function walleve_contentheader() {
	do_action('walleve_contentheader'); 
	if(TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/contentheader.php')) {
		load_template(STYLESHEETPATH . '/contentheader.php');
	} else {
		load_template(TEMPLATEPATH . '/contentheader.php');
	}
}

function walleve_contentfooter() {
	do_action('walleve_contentfooter'); 
	if(TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/contentfooter.php')) {
		load_template(STYLESHEETPATH . '/contentfooter.php');
	} else {
		load_template(TEMPLATEPATH . '/contentfooter.php');
	}
}

function walleve_sidebar() {
	do_action('walleve_sidebar');
	if(TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/sidebar.php')) {
		load_template(STYLESHEETPATH . '/sidebar.php');
	} else {
		load_template(TEMPLATEPATH . '/sidebar.php');
	}
}

//css文件支持
function walleve_css() { ?>
	<link type="text/css" href="<?php bloginfo('template_url'); ?>/css/classes.css" media="all" rel="stylesheet" />
	<link type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" rel="stylesheet" />
	<link type="text/css" href="<?php bloginfo('template_url'); ?>/css/print.css" media="print" rel="stylesheet" />
	<?php do_action('walleve_css'); ?>
<?php } 

function walleve_tags_front() {
	$tags = ' ' . the_tags('- Tags', ', ', '') . ' ';
	echo apply_filters('walleve_tags_front', $tags);
}

function walleve_404_message() {
	$message = '<h2 id="pagetitle">404</h2>';
	$message .= '<p>很抱歉没有提供适合你的内容。</p>';
	$message .= '<p>如果您不介意再花费一点时间，请尝试了解一下这个博客 <a href="'.get_bloginfo('url').'/about">点击了解</a></p>';
	return apply_filters('walleve_404_message', $message);
}

function walleve_doctype() {
	$doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
	return apply_filters('walleve_doctype', $doctype);
}

if ( function_exists('register_sidebars') ){
	register_sidebars(2, array(
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	));
}

function walleve_sidbar_searchfrom(){ ?>
<li id="search">
		<form id="searchform" method="get" action="<?php bloginfo('url'); ?>">
			<div>
				<input type="text" value="" name="s" id="s" />
				<input type="submit" class="submit" accesskey="s" value="Search" />
			</div>
			</form>
		</li>
<?php }
?>
